



clear 
set scheme lean2, permanent
global pm = char(177)
set more off

gl date = c(current_date)
if c(os) == "MacOSX" gl user "/Users/`c(username)'"
else if c(os) == "Windows" gl user "C:\Users\\`c(username)'"
else if c(os) == "Unix" gl user "/usr/`c(username)'"
di "$user

set graphics on  
 
global path_data_processed "\data\processed"
global path_output "\data\output"


clear
cd "$path_data_processed"
use "robustnessexperiment1.dta"

drop if  prior_recession=="NA"
gen noincentive = fl_151_do=="PriorRecession-noincentive"
tab noincentive
drop in 1/2

gen republican = pol=="Republican"
gen democrat = pol=="Democrat"

destring *, replace


gen republican_noincentive = noincentive*republican
gen democrat_noincentive = noincentive*democrat

ksmirnov prior_recession, by(noincentive)

reg prior_recession  noincentive 
reg prior_recession  noincentive if emply=="Employed full-time"


reg prior_recession  noincentive republican democrat
reg prior_recession noincentive republican democrat democrat_noincentive republican_noincentive


 cd "$path_output"


  hist prior_recession, xtitle("Recession Expectations: Consumers")  fraction  width(2)
  graph save "priors2018_pooled.gph", replace
graph export "priors2018_pooled.pdf", replace
 

  hist prior_recession if noincentive==1, xtitle("Recession Expectations (No Incentives)")  fraction  width(2)
  graph save "priors2018_noincentive.gph", replace
graph export "priors2018_noincentive.pdf", replace
 

  hist prior_recession if noincentive==0, xtitle("Recession Expectations (With Incentives)")  fraction  width(2)
  graph save "priors2018_incentive.gph", replace
graph export "priors2018_incentive.pdf", replace
 

graph combine "priors2018_incentive.gph" "priors2018_noincentive.gph", xcommon ycommon col(2)
graph export "priorsbyincentive.pdf", replace



